Computer systems and other electronic systems may contain memory that includes, for example, dynamic random access memory (DRAM) chips. The DRAMs may be organized, for example, onto memory boards or partitioned into dual in line memory modules (DIMMS). This memory may be virtualized by an operating system associated with a computer system. The operating system may be responsible for allocating physical and/or virtual memory to applications. The applications may have varying memory usage requirements like the amount of memory needed, the time period for which the memory is needed, and the like. An application may fail if there is an error in the memory allocated to it. However, the repercussions associated with an application failing may vary. For example, a memory error that leads to a failure in a nuclear power plant control application may have different repercussions than a memory error that leads to a failure in a screen-saver application. Although memory failures in both types of applications are to be avoided, a nuclear power plant crash may have more serious repercussions than a screen saver crash.
Some systems may attempt to minimize overall memory failures (and thus related application failures) using CRC (cyclic redundancy checking) protection. Other systems may attempt to minimize the likelihood of failures due to memory errors through memory monitoring and page deallocation. For example, pages where a memory error has been experienced or pages where some pre-determined number of errors have been encountered may be taken off line and not used. This technique makes these de-allocated pages unusable, which reduces the total amount of memory available. Still other systems may swap in hardware when a block of memory has failed. If the spare memory on the swapped in hardware is consumed then applications whose failures can lead to dire consequences (e.g., nuclear reactor monitor program) may be allocated “less healthy” memory and be more susceptible to failures.
As mentioned above, a computer system may employ virtual memory. Virtual memory may be thought of as an imaginary or logical (e.g., not physical) memory area that provides an alternate, oftentimes larger, set of memory addresses. Programs may store instructions and data in these virtual addresses. Then, when an instruction is actually executed or a piece of data is actually referenced, the instruction or data, or more typically a larger subset of memory (e.g., a page) in which the addressed item is located is moved to physical memory if it is not already resident in physical memory. A mapping between the imaginary virtual address and the actual physical address may be stored, for example, in a page table. To facilitate efficient address mapping resolution, portions of the page table may be stored in a translation lookaside buffer.
Virtual memory is typically employed to enlarge the address space available to a program. Virtual memory also facilitates decoupling physical memory addressing from application programming. As mentioned above, addressable items like instructions and/or data associated with a virtual memory page may be brought into physical memory when a logic determines that an addressed item is not in physical memory. Detecting that an addressed item is not in physical memory may be referred to as detecting a memory fault. When memory is organized into pages, this may be referred to as detecting a page fault. When a page fault is detected, an allocation of physical memory may occur, which may include creating and recording a mapping between the virtual address and the physical address. In some systems, the physical allocation may change over time and thus the virtual to physical mapping may also change. Applications usually remain unaware of page fault detection and handling, physical memory allocation, address mapping, and the like, since these operations are typically performed by an operating system or lower level logic.
Some components of a typical virtual memory system are illustrated in FIG. 9. A physical memory 900, which includes subsets (e.g., pages) of memory 902 through 908 may be operably connected to and/or accessible by a processor 910. A virtual memory 920, which includes a larger number of subsets (e.g., pages) of memory 922 through 928 may also be available to the system associated with the physical memory 900 and the processor 910. If the processor 910 attempts to access an addressable item located in the virtual memory 920, and page table 930 indicates that the addressable item (and/or its page) are not currently stored in physical memory 900, then the page fault handler 940 may cause a subset of the virtual memory 920 to be copied into the physical memory 900, and may update the page table 930 to reflect the virtual to physical memory mapping.